package com.jmemoir.orm.mybatis.service.impl;

import com.github.pagehelper.PageHelper;
import com.jmemoir.orm.mybatis.entity.SysUser;
import com.jmemoir.orm.mybatis.mapper.SysUserMapper;
import com.jmemoir.orm.mybatis.service.SysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户接口-实现类
 *
 * @author Tellsea
 * @date 2023/8/4
 */
@Service
@RequiredArgsConstructor
public class SysUserServiceImpl implements SysUserService {

    private final SysUserMapper sysUserMapper;

    @Override
    public List<SysUser> queryPage(SysUser entity) {
        PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
        return sysUserMapper.queryPage(entity);
    }

    @Override
    public List<SysUser> queryList(SysUser entity) {
        return sysUserMapper.queryList(entity);
    }

    @Override
    public SysUser getById(Long id) {
        return sysUserMapper.getById(id);
    }

    @Override
    public void add(SysUser entity) {
        sysUserMapper.add(entity);
    }

    @Override
    public void updateById(SysUser sysUser) {
        sysUserMapper.updateById(sysUser);
    }

    @Override
    public void removeById(Long id) {
        sysUserMapper.removeById(id);
    }

    @Override
    public void removeByIds(List<Long> ids) {
        sysUserMapper.removeByIds(ids);
    }
}
